package com.yuhong.reggie.mapper;

import com.yuhong.reggie.entity.Employee;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface EmployeeMapper {

    @Select("select * from employee where username=#{username}")
    public Employee login(Employee employee);

    //添加员工
    @Insert("insert into employee values(null,#{name},#{username},#{password},#{phone},#{sex},#{idNumber}," +
            "#{status},#{createTime},#{updateTime},#{createUser},#{updateUser})")
    Integer save(Employee employee);

    //根据员工姓名查询员工列表
    List<Employee> findByName(String name);
    //修改员工数据
    Integer update(Employee employee);

    //根据id查询
    @Select("select * from employee where id=#{id}")
    Employee findById(Integer id);
}
